fix: logging initialization for kafka consumer generated code#242
fix: logging initialization for kafka consumer generated code#242sancheet230 wants to merge 1 commit intoasyncapi:masterfrom
Conversation
Signed-off-by: sancheet230 <sancheet.p24@medhaviskillsuniversity.edu.in>
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|
|
@AGurlhosur @dalelane @dan-r @KieranM1999 @lewis-relph @asyncapi-bot-eve Ready for review |
|
Can you explain what compiler error you're trying to solve, please? As I understand the current intent behind the code, the logger is provided in the superclass. While I could perhaps see an argument for having separate loggers for every class rather than sharing, that's rather more subjective than the critical compile error you seem to be seeing. |
Further to that, if we go with a separate-loggers approach, I think it would be better to do that across the board (i.e. what about producers) rather than just for the one isolated example. |
|
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |



Description
This PR addresses a critical issue with logging in the generated Kafka consumer code. Previously, calls to
logger.info(...)were made without a properly defined logger, which would cause compile-time errors. The fix introduces a standard logger initialization in the consumer declaration:This change ensures that all logging calls have a valid reference, aligning with Java best practices for logging. While this PR resolves the logging issue, please note that placeholders like
recordFailure(ex)and the reference toch(used in the consumer constructor) are still present and will need to be addressed in subsequent updatesRelated issue(s)
Fixes #241